package com.indra.bbva.pe.monitor.in.converter;

import java.util.Map;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;

@FacesConverter(value="mapComboConverter2")
public class MapComboConverter2 extends SelectItemsBaseConverter{
	@Override
	public String getAsString(FacesContext arg0, UIComponent arg1, Object value)
			throws ConverterException {
		if (value == null || !(value instanceof Map<?,?>)) {
			return null;
		}
		
		if(((Map<String,String>)value).get("DESCRIPCION") == null){
			return "";
		}else{
			return ((Map<String,String>)value).get("DESCRIPCION");
		}
	}
}
